import type { Page } from 'playwright'

// 统一步骤等待时长
export const STEP_DELAY_MS = 500

// 等待一个步骤，便于肉眼观察操作效果；输出中文日志
export async function waitStep(win: Page, label = '步骤停顿', ms: number = STEP_DELAY_MS) {
  const duration = Number(ms) || STEP_DELAY_MS
  console.log(`[测试等待] ${label}，时长 ${duration} ms`)
  await win.waitForTimeout(duration)
}
